package com.refactoring.demo.chapter01.price;

import com.refactoring.demo.chapter01.Movie;

/**
 * @作者：刘富国
 * @创建时间：2018/4/26 11:52
 */
public class ChildrensPrice extends Price {

    @Override
    int getPriceCode() {
        return Movie.CHILDRENS;
    }

    @Override
    public double getCharge(Integer daysRented) {
        double result = 1.5;
        if (daysRented > 3)
            result += (daysRented - 3) * 1.5;
        return result;
    }
}
